<style type="text/css">

.addform {font-size:14px;font-family:"Microsoft YaHei";}

.addform p{line-height:36px;}

.addform p .text{ width:320px; border:1px solid #cccccc; height:24px; line-height:24px; padding:2px 5px;margin:5px; }

.addform p label{display:inline-block;width:80px;vertical-align:top;}

.addform p #myeventsubmit{line-height:28px;height:36px;padding:3px 10px;background:#EEEEEE;border:1px solid #999999}

#add_form_pics img{ width:60px; height:60px; margin:5px; padding:5px;border:1px solid #EEEEEE;}

</style>

<div id="shareshow" class="grayline cf addform" style="line-height:36px;">

	<p>

		<label for="add_event_title">活动标题：</label>

		<input type="text" class="text" name="add_event_title" id="add_event_title" value=""/>

	</p>

	<p>

		<label for="add_event_timestart">活动时间：</label>

		<input type="text" class="text" name="add_event_timestart" id="add_event_timestart" value="<?echo date('Y-m-d H:i:s');?>"/> *开始

	</p>

	<p>

		<label for="add_event_timeend"></label>

		<input type="text" class="text" name="add_event_timeend" id="add_event_timeend" value="<?echo date('Y-m-d H:i:s',time()+2592000);?>"/> *结束

	</p>

	<p>

		<label for="add_event_name">发起者：</label>

		<input type="text" class="text" name="add_event_name" id="add_event_name" value=""/>

	</p>

	<p>

		<label for="add_event_tel">电话：</label>

		<input type="text" class="text" name="add_event_tel" id="add_event_tel" value=""/>

	</p>

	<p>

		<label for="add_event_add">地址：</label>

		<input type="text" class="text" name="add_event_add" id="add_event_add" value=""/>

	</p>

	<p>

		<label for="add_event_detail">活动简介：</label>

		<textarea class="text" style="width:570px;height:160px;" name="add_event_detail" cols="36" rows="6" id="add_event_detail"></textarea>

	</p>

	<p>

		<label for="add_event_pics">活动图片：</label>

		<input type="text" readonly="readonly" class="text" name="add_event_pics" id="add_event_pics" value="{if $_POST['img'] != ''} {$_POST['img']} {/if}"/>

		<input type="button" style="background:#27B6BC; color:#FFFFFF; border:1px; height:28px; line-height:28px;width:60px;padding:auto 15px;" onclick="window.open('{$_FANWE[site_root]}eventup.php', '图片批量上传', 'left=56,top=42,directories=no,width=430,height=300,location=no,menubar=no,resizable=no,scrollbars=no,status=no,toolbar=no', true);" value="上传图片">

	</p>

	<div id="add_form_pics" style="margin:5px auto;">{if $_POST['img'] != ''} <img src="{$_POST['img']}" width="60" height="60"> {/if}</div>

	<p align="right">

		<label for="add_event_detail"></label>

		<input id="myeventsubmit" type="button" value="发布"/>

	</p>

<script type="text/javascript">

function pickTime(id){

	html_y = html_m = html_d = html_h = html_i = html_s = "";

	for(yy=<?php echo date('Y');?>; yy<<?php echo date('Y');?>+2; yy++){

		html_y +=  '<option id="pt_y" value="'+yy+'">'+yy+'</option>';

	}

	for(mm=0; mm<12; mm++){

		if( mm<10 ){ mm = "0"+mm ;}

		html_m +=  '<option id="pt_m" value="'+mm+'">'+mm+'</option>';

	}

	for(mm=0; mm<12; mm++){

		if( mm<10 ){ mm = "0"+mm; }

		html_m +=  '<option id="pt_m" value="'+mm+'">'+mm+'</option>';

	}

	$.dialog({

		title: '参加人员信息：',lock: true,

		content: '<p><select name="pick_time" id="pick_time"><option id="pt_y" value=></option></select></p>'

	});

}

jQuery(function(){
<!--{if $_FANWE['uid']==0}-->

	$.dialog({

		title: '提示：',lock: true, fixed: true, focus: true,

		content: '<b>请登录后查看此页面！</b>',
		
		cancelValue: '登录',
		
		cancel: function(){location.href='{u user/login}';return false;}

	});
<!--{else}-->


	$("#myeventsubmit").bind({

		click: function(){

			if( $("#add_event_title").val()=="" ){$.alert('活动主题不能为空！'); return false;}
			if( $("#add_event_name").val()=="" ){$.alert('发起者不能为空！'); return false;}
			if( $("#add_event_tel").val()=="" ){$.alert('请留下联系电话！'); return false;}
			if( $("#add_event_add").val()=="" ){$.alert('活动地址不能为空！'); return false;}
			if( $("#add_event_pics").val()=="" ){$.alert('请上传至少一张图片！'); return false;}
			
			$.ajax({

			   type: "POST",

			   url: "{u event/list type=ajax,order=savenew}",

			   data: {	title: $("#add_event_title").val(),  

						t_start: $("#add_event_timestart").val(),

						t_end: $("#add_event_timeend").val(),

						name: $("#add_event_name").val(),

						tel: $("#add_event_tel").val(),

						add: $("#add_event_add").val(),

						detail: $("#add_event_detail").val(),

						pics: $("#add_event_pics").val()

				},

			   dataType: "json",

			   beforeSend: function(){

					$.dialog({

						id: "ajax_dialog",

						title: '提示：',lock: true, fixed: true, 

						content: '数据加载中，请稍后...'

					});

			   },

			   success: function(d){

					$.dialog.get('ajax_dialog').close();

					if(d.msg=="success"){

						$.dialog({

							title: '提示：',lock: true,

							content: '活动添加成功！'

						});
						
						location.href='{u event/index}';

					}else if(d.msg=="notlogin"){			

						$.dialog({

							title: '提示：',time:2000,

							content: '您还没登录！不能发起活动！'

						}); 
						
						location.href='{u user/login}';

					}else{ 				

						$.dialog({

							title: '提示：',time:2000,

							content: '添加失败！'

						}); 

					}

			   }

			});

	}});
<!--{/if}-->
});

</script>

    <div class="blank9"></div>

</div>

</form>